﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using PresentationNamespace;
using System.IO;

namespace InfrastructureNamespace
{
    public class Log : ILog
    {
        List<string> items = new List<string>();

        public void Add(string message)
        {
            items.Add(message);
        }

        public ReadOnlyCollection<string> Items
        {
            get
            {
                return new ReadOnlyCollection<string>(items);
            }
        }

        public void WriteText(TextWriter writer)
        {
            new LogTextWriter().Write(this, writer);
        }

        public void WriteHtml(TextWriter writer)
        {
            new LogHtmlWriter().Write(this, writer);
        }
    }
}
